package com.example.vm.controller.user;

import com.common.domain.R;
import com.example.vm.domain.entity.Type;
import com.example.vm.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("user-type")
@RequestMapping("/type/user")
public class TypeController {
    @Autowired
    private TypeService typeService;
    /**
     * 获取所有的分类
     * @return
     */
    @GetMapping("/listAll")
    public R listAllType(){
        List<Type> types = typeService.list();
        return R.ok().data(types);
    }
}
